#ifndef CAN_RECEIVE_H
#define CAN_RECEIVE_H

#include "can.h"

#define CHASSIS_CAN hcan1
#define GIMBAL_CAN hcan2


/* CAN send and receive ID */
typedef enum
{
	CAN_FRICTION_RIGHT_ID = 0x201,
    CAN_FRICTION_LEFT_ID = 0x202,

} can_msg_id_e;

typedef struct
{
    uint16_t ecd;
    int16_t speed_rpm;
    int16_t given_current;
    uint8_t temperate;
    int16_t last_ecd;
} motor_measure_t;

typedef struct
{
	uint8_t boards[5];
	uint8_t color;
	uint8_t brightness;
	uint8_t reserved;
} messsage;

extern void CAN_cmd_gimbal(int16_t yaw, int16_t pitch, int16_t trigger, int16_t rev);
void CAN_cmd_friction(int16_t left, int16_t right, int16_t rev1, int16_t rev2);

//
void CAN_cmd_yaw(int16_t yaw);
void CAN_USER_Transmit(CAN_HandleTypeDef *hcan, uint32_t ID,int16_t value1, int16_t value2, int16_t value3, int16_t value4);
void CAN_Board_Transmit(CAN_HandleTypeDef *hcan, uint32_t ID, messsage * Messagetransmit);
#endif
